wx.cloud.init()
const db = wx.cloud.database();
// app.js
App({
  globalData: {
    statusBarHeight: 0,
    navBarHeight: 0,
    index:'',
    study_index:'',
    userInfo:null,
    perjumpid:''
  },
  onLaunch() {
    //自定义导航栏 获取设备顶部窗口的高度（不同设备窗口高度不一样，根据这个来设置自定义导航栏的高度）
    wx.cloud.init({
      env: "cloud1-2gc7w4lq7470e9d9"
    }),
    console.log('app')
    if(wx.getStorageSync('user')){
      this.globalData.userInfo = wx.getStorageSync('user')
      console.log('get storage')
    }
    wx.getSystemInfo({
      success: (res) => {
        let custom = wx.getMenuButtonBoundingClientRect()
        this.globalData.statusBarHeight = res.statusBarHeight
        this.globalData.navBarHeight = custom.height + (custom.top - res.statusBarHeight) * 2
      }
    }),
    db.collection('Users').get({
      success: res => {
        this.setData({
          // Users: res.data,
        })
      }
    })
  },
})

